package com.sos.core.game.engine.events
{
	import com.sos.core.game.engine.GameEngine;
	
	public class GameEngineErrorEvent extends GameEngineEvent
	{
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _message:String;
		private var _error:Error;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		public function GameEngineErrorEvent(engine:GameEngine, message:String, error:Error)
		{
			// ancestor constructor
			super(GameEngineEvent.EVENT_GAME_ENGINE_ERROR, engine);
			// Init
			_message = message;
			_error = error;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------
		
		public function get message():String
		{
			return _message;
		}

		public function get error():Error
		{
			return _error;
		}
		
		public function get hasError():Boolean
		{
			return _error != null;
		}


	}
}